﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BUGCOME.Model.Logs.Dto
{
    /// <summary>
/// 短信验证码记录查询对象 - 用于封装短信日志查询条件
/// </summary>
public class SmscodeLogQueryDto : PagerInfo 
{
    /// <summary>
    /// 用户ID查询条件
    /// </summary>
    /// <remarks>精确匹配</remarks>
    public int? Userid { get; set; }

    /// <summary>
    /// 手机号码查询条件
    /// </summary>
    /// <remarks>精确匹配</remarks>
    public long? PhoneNum { get; set; }

    /// <summary>
    /// 发送时间范围查询 - 开始时间
    /// </summary>
    /// <remarks>包含此时间点之后的记录</remarks>
    public DateTime? BeginAddTime { get; set; }

    /// <summary>
    /// 发送时间范围查询 - 结束时间
    /// </summary>
    /// <remarks>包含此时间点之前的记录</remarks>
    public DateTime? EndAddTime { get; set; }

    /// <summary>
    /// 发送类型查询条件
    /// </summary>
    /// <value>1=登录 2=注册 3=找回密码</value>
    public int? SendType { get; set; }
}

/// <summary>
/// 短信验证码记录数据传输对象 - 用于前后端数据交互
/// </summary>
public class SmsCodeLogDto
{
    /// <summary>
    /// 记录唯一标识
    /// </summary>
    [Required(ErrorMessage = "Id不能为空")]
    [ExcelColumn(Name = "Id")]
    [ExcelColumnName("Id")]
    [JsonConverter(typeof(ValueToStringConverter))]
    public long Id { get; set; }

    /// <summary>
    /// 短信验证码内容
    /// </summary>
    [ExcelColumn(Name = "短信验证码")]
    [ExcelColumnName("短信验证码")]
    public string SmsCode { get; set; }

    /// <summary>
    /// 关联用户ID
    /// </summary>
    [ExcelColumn(Name = "用户id")]
    [ExcelColumnName("用户id")]
    public int? Userid { get; set; }

    /// <summary>
    /// 接收短信的手机号码
    /// </summary>
    [ExcelColumn(Name = "手机号")]
    [ExcelColumnName("手机号")]
    [JsonConverter(typeof(ValueToStringConverter))]
    public long? PhoneNum { get; set; }

    /// <summary>
    /// 短信完整内容
    /// </summary>
    [ExcelColumn(Name = "短信内容")]
    [ExcelColumnName("短信内容")]
    public string SmsContent { get; set; }

    /// <summary>
    /// 短信发送时间
    /// </summary>
    [ExcelColumn(Name = "添加时间", Format = "yyyy-MM-dd HH:mm:ss")]
    [ExcelColumnName("添加时间")]
    public DateTime? AddTime { get; set; }

    /// <summary>
    /// 请求发送短信的用户IP
    /// </summary>
    [ExcelColumn(Name = "用户IP")]
    [ExcelColumnName("用户IP")]
    public string UserIP { get; set; }

        /// <summary>
        /// 短信发送类型
        /// </summary>
        /// <value>1=登录验证 2=注册验证 3=找回密码 4=信息变更 5=支付确认</value>
        [ExcelColumn(Name = "发送类型")]
    [ExcelColumnName("发送类型")]
    public int? SendType { get; set; }

    /// <summary>
    /// 根据IP解析的地理位置信息
    /// </summary>
    [ExcelColumn(Name = "地理位置")]
    [ExcelColumnName("地理位置")]
    public string Location { get; set; }

   
}
}
